module.exports = {
  nav_name: '动态管理', //生成导航菜单
  module_name: 'dynamic_manager',  //生成路径，与模块名相同
  api: `{
    //动态列表
    page: commonPath + "/admin/dynamicinfo/pageList", //分页 额外参数
    detail: commonPath + '/admin/dynamicinfo/get',  //详情 get 额外参数
    add: commonPath + '/admin/dynamicinfo/dynamicIssue',  //添加 额外参数
    del: commonPath + "/admin/dynamicinfo/remove", //删除

    //用户动态
    changeState: commonPath + "/admin/dynamicinfo/editState", //编辑状态
    // edit: commonPath + "/admin/dynamicinfo/edit", //编辑
  }`,


  //用户动态
  table1: {
    table_name: "user_dynamic_list",
    nav_name: "用户动态列表",
    tipsText: "动态管理 >> 用户动态列表",
    pageApi: "API.dynamic_manager.page",  //自定义api，高优先级，未设置则取默认page的api
    extraPageRequestParams: `
      type: 2,  //2用户动态
    `, //已有page和pageSize
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      { title: '用户昵称', name: 'userName', type: "normal", showObj: "{}" },
      {
        title: '状态',
        name: 'autoState',
        type: "opts",
        showName: "autoStateShow",
        showObj: `{
          "0": "待审核",
          "1": "审核成功",
          "2": "审核失败",
        }`
      },
      { title: '发布时间', name: 'gmtModified', type: "normal", showObj: "{}" },
    ],
    tableOpt: [
      {
        type: "view",
        text: "查看",
        request: false,
        jump: "/dynamic_manager_user_dynamic_detail"
      },
      {
        type: "changeState",
        text: "通过",
        request: true,
        url: "API.dynamic_manager.changeState",
        requestType: 'post',
        params: `{ id, state: 1 }`,
        methodNameTag: 'Pass', //方法衔接拓展名 用于标志不同方法
        isSplitSearchString: 'true', //拼接查询字符串
        showCondition: "scope.row.autoState == '0'",
      },
      {
        type: "changeState",
        text: "拒绝",
        request: true,
        url: "API.dynamic_manager.changeState",
        requestType: 'post',
        params: `{ id, state: 2 }`,
        methodNameTag: 'Reject', //方法衔接拓展名 用于标志不同方法
        isSplitSearchString: 'true', //拼接查询字符串
        showCondition: "scope.row.autoState == '0'",
      },
    ],
    search: {
      contentArr: {
        // input1: { labelName: '账号名', inputName: 'tel' },
        // input2: { labelName: '姓名', inputName: 'realName' },
        // select1: {
        //   labelName: '性别',
        //   inputName: 'sex',  //输入绑定的变量
        //   selectOptsName: "sexOpts",
        //   selectOptsArr: `[
        //     { value: "M", label: "男" },
        //     { value: "F", label: "女" },
        //     { value: "", label: "全部" },
        //   ],
        //   `, //选项数组
        // },
        // select2: {
        //   labelName: '来源终端',
        //   inputName: 'sourceTerminal',
        //   selectOptsName: "sourceTerminalOpts",
        //   selectOptsArr: `[
        //     { value: "android", label: "android" },
        //     { value: "IOS", label: "IOS" },
        //     { value: "h5", label: "h5" },
        //     { value: "", label: "全部" },
        //   ],
        //   `,
        // },
        // date1: {
        //   labelName: '注册时间',
        //   inputName: 'registerTime',
        //   dateConfig: {
        //     startDateName: 'registerStartDate',
        //     endDateName: 'registerEndDate',
        //     dateChangeMethodsName: 'handleRegisterDateChange'
        //   }
        // },
        // date2: {
        //   labelName: '最后一次登录时间',
        //   inputName: 'lastLoginTime',
        //   dateConfig: {
        //     startDateName: 'lastLoginStartTime',
        //     endDateName: 'lastLoginEndTime',
        //     dateChangeMethodsName: 'handleLastLoginDateChange'
        //   }
        // },
      },
      // searchBtn: {
      //   text: "查询", //链接与table请求接口相同，不做另外配置
      // },
    },
  },

  //详情页面
  detail_page1: {
    isGenerate: "false",
    detail_page_name: "user_dynamic_detail",
    detail_api: "API.dynamic_manager.detail",
    request_params: `{
        id,
      }`,
    tipsText: "动态管理 >> 用户动态",
    formData: {
      // titleText: "请填写管理员相关信息",
      item1: {
        labelName: "动态内容",
        inputName: 'remark',
        type: "normal",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },

      item2: {
        labelName: '动态图片',
        inputName: 'photo',
        type: "img",
      },
      item3: {
        labelName: '动态类型',
        inputName: 'type',
        type: "innerCode",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
        innerCode: `{{formData.forwardType ? "转载" : "原创"}}`,
      },
      item4: {
        labelName: '用户昵称',
        inputName: 'company',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      item4: {
        labelName: '发布时间',
        inputName: 'gmtModified',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
    },

    // //额外请求
    // extraRequest: {
    //   dataCode: [ 
    //     "courseTypeOpts"
    //   ],
    //   methodsCode: [
    //     {
    //       explainText: "课程类别获取", //说明
    //       type: "opts",  //表示选项类型格式，value, label
    //       methodName: "getCourseTypeData",
    //       api: "API.course_manager.course_sort_page",
    //       dataName: "courseTypeOpts",
    //       params: `{
    //         "pageIndex": 1,
    //         "pageSize": 100,
    //       }`,
    //       optsConfig: {
    //         label: "typeName",
    //         value: "id"
    //       }
    //     }
    //   ]
    // },

  },


  //商会动态管理列表
  table2: {
    table_name: "business_dynamic_list",
    nav_name: "商会动态管理列表",
    pageApi: "API.dynamic_manager.page",  //自定义api，高优先级，未设置则取默认page的api
    tipsText: "动态管理 >> 商会动态管理列表",
    extraPageRequestParams: //已有page和pageSize
      `
      type: 1,  //1商会动态
    `,
    //获取列表页面
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      {
        title: '动态图片', 
        name: 'photo',
        type: "img",
        heightVal: "60",
        widthVal: "100",
      },
      {
        title: '类型', //内嵌时不填或temp
        name: '',
        type: "innerCode",
        innerCode: `{{scope.row.forwardType ? "原创" : "原创"}}`,
      },
      { title: '发布时间', name: 'gmtModified', type: "normal", showObj: "{}" },
    ],
    tableOpt: [
      {
        type: "view",
        text: "查看",
        request: false,
        jump: "/dynamic_manager_detail_business_dynamic"
      },
      // {
      //   type: "modify",
      //   text: "编辑",
      //   request: false,
      //   jump: "/dynamic_manager_add_business_dynamic",
      // },
      {
        type: "del",
        text: "删除",
        request: true,
        url: "API.dynamic_manager.del",
        requestType: 'get',
        // isSplitSearchString: 'true', //拼接查询字符串
      },
    ],
    search: {
      contentArr: {
        // input1: { labelName: '账号名', inputName: 'tel' },
        // input2: { labelName: '姓名', inputName: 'realName' },
        // select1: {
        //   labelName: '性别',
        //   inputName: 'sex',  //输入绑定的变量
        //   selectOptsName: "sexOpts",
        //   selectOptsArr: `[
        //     { value: "M", label: "男" },
        //     { value: "F", label: "女" },
        //     { value: "", label: "全部" },
        //   ],
        //   `, //选项数组
        // },
        // select2: {
        //   labelName: '来源终端',
        //   inputName: 'sourceTerminal',
        //   selectOptsName: "sourceTerminalOpts",
        //   selectOptsArr: `[
        //     { value: "android", label: "android" },
        //     { value: "IOS", label: "IOS" },
        //     { value: "h5", label: "h5" },
        //     { value: "", label: "全部" },
        //   ],
        //   `,
        // },
        // date1: {
        //   labelName: '注册时间',
        //   inputName: 'registerTime',
        //   dateConfig: {
        //     startDateName: 'registerStartDate',
        //     endDateName: 'registerEndDate',
        //     dateChangeMethodsName: 'handleRegisterDateChange'
        //   }
        // },
        // date2: {
        //   labelName: '最后一次登录时间',
        //   inputName: 'lastLoginTime',
        //   dateConfig: {
        //     startDateName: 'lastLoginStartTime',
        //     endDateName: 'lastLoginEndTime',
        //     dateChangeMethodsName: 'handleLastLoginDateChange'
        //   }
        // },
      },
      // searchBtn: {
      //   text: "查询", //链接与table请求接口相同，不做另外配置
      // },
      addBtn: {
        //搜索栏具有添加功能按钮时，设置此字段
        type: "add",
        text: "动态发布",
        request: false,
        jump: "/dynamic_manager_add_business_dynamic"
      }
    },
  },


  //添加页面
  add_page2: {
    isGenerate: 'false',
    add_page_name: "add_business_dynamic",
    tipsText: "动态管理 >> 动态发布",
    formData: {
      //三种类型，输入，下拉，图片上传
      textarea1: {
        labelName: '动态内容',
        inputName: 'remark',
        isNeed: 'true',
        rows: "5",
        width: "360", //自动补全px
      },
      //图片上传
      uploadImg1: {
        labelName: "动态图片",
        inputName: "photo",
        type: "many", //type: "single"
        countLimit: "1",
        uploadMethod: "handleUploadBanner",
        isNeed: 'true',
      },
      // //选择
      // select1: {
      //   labelName: '转发类别',
      //   inputName: 'forwardType',  //输入绑定的变量
      //   selectOptsName: "forwardTypeOpts",
      //   selectOptsArr: `[
      //       { value: "1", label: "文章" },
      //       { value: "2", label: "动态" },
      //       { value: "3", label: "课程" },
      //       { value: "", label: "原创" },
      //     ],
      //     `, //选项数组
      //   isNeed: 'true',
      // },

      // //三级联动组件
      // address1: {
      //   label: "地址选择",
      //   inputName: "",
      // }
    },
    addBtn: {
      text: '发布',
      url: "API.dynamic_manager.add",
    },
    editBtn: {
      text: '编辑',
      detailUrl: "API.dynamic_manager.detail",
      editUrl: "API.dynamic_manager.edit",
      jump: '/dynamic_manager_dynamic_list',
      isSplitSearchString: 'true', //列表拼接查询字符串
    },
    cancelBtn: { text: "取消" }, //
  },


  //详情页面
  detail_page2: {
    detail_page_name: "detail_business_dynamic",
    detail_api: "API.dynamic_manager.detail",
    request_params: `{
      id,
    }`,
    tipsText: "动态管理 >> 商会动态详情",
    formData: {
      // titleText: "请填写管理员相关信息",
      item1: {
        labelName: '动态内容',
        inputName: 'remark',
        type: "normal",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },

      item2: {
        labelName: '动态图片',
        inputName: 'photo',
        type: "img",
      },
      item3: {
        labelName: '动态类型',
        inputName: 'type',
        type: "innerCode",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
        innerCode: `{{formData.forwardType ? "转载" : "原创"}}`,
      },
      item4: {
        labelName: '用户昵称',
        inputName: 'company',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      item4: {
        labelName: '发布时间',
        inputName: 'gmtModified',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      // item5: {
      //   labelName: '最近登录时间',
      //   inputName: 'courseContent',
      //   frontTips: "", //后面的说明
      //   behindTips: "", //前面的说明
      // },
    },

    // //额外请求
    // extraRequest: {
    //   dataCode: [ 
    //     "courseTypeOpts"
    //   ],
    //   methodsCode: [
    //     {
    //       explainText: "课程类别获取", //说明
    //       type: "opts",  //表示选项类型格式，value, label
    //       methodName: "getCourseTypeData",
    //       api: "API.course_manager.course_sort_page",
    //       dataName: "courseTypeOpts",
    //       params: `{
    //         "pageIndex": 1,
    //         "pageSize": 100,
    //       }`,
    //       optsConfig: {
    //         label: "typeName",
    //         value: "id"
    //       }
    //     }
    //   ]
    // },

  }
}
